package com.smartcat.service.impl;

import java.util.List;

import com.smartcat.dao.TranslateDataMapper;
import com.smartcat.model.TranslateData;
import com.smartcat.model.TranslateDataExample;
import com.smartcat.service.StudyService;
import com.smartcat.web.SplitPage;

public class StudyServiceImpl implements StudyService{

	private TranslateDataMapper TranslateDataMapper;
	
	
	
	public void setTranslateDataMapper(
			TranslateDataMapper TranslateDataMapper) {
		this.TranslateDataMapper = TranslateDataMapper;
	}



	@Override
	public List<TranslateData> getTranslateInfo(int userId,SplitPage splitPage) {
		
		TranslateDataExample tdiExample=new TranslateDataExample();
		tdiExample.or().andUserIdEqualTo(userId);
		
		tdiExample.setOrderByClause("translate_date desc"+splitPage.getSplitString());
		
//		List<TranslateData> list=new ArrayList<TranslateData>();
//		TranslateData tdi=TranslateDataMapper.selectByPrimaryKey(1);
//		list.add(tdi);
		return TranslateDataMapper.selectByExample(tdiExample);
	}

}
